package cn.edu.scau.cmi.yangzhengkai.composite.consistent;

import java.util.Set;

public class ConsistentLeaf extends ConsistentComponent{
	
	private String name;
	
    public ConsistentLeaf() {
	
    }
    
    public ConsistentLeaf(String name) {
    	this.name = name;
    }
    
    public ConsistentLeaf(String name, ConsistentComponent parent) {
    	this(name);
    	this.parent = parent;
    }
	

	@Override
	public String doSomething() {
		System.out.println("this is consistentLeaf");
		return null;
	}

	@Override
	public ConsistentComponent getParent() {
		return parent;
	}

	@Override
	public ConsistentComponent addChild(ConsistentComponent child) {
		return this;
	}

	@Override
	public ConsistentComponent deleteChild(ConsistentComponent child) {
		return this;
	}

	@Override
	public Set<ConsistentComponent> getChildren() {
		return null;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
    public String toString() {
		
		return this.name;
	}



}